import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooUctooRoleController } from '../../../controllers';
const uctoouctooRoleRouter = new Router();
const uctooRoleController = new uctooUctooRoleController();

uctoouctooRoleRouter.post('/add', requireUser, uctooRoleController.add);
uctoouctooRoleRouter.post('/edit', requireUser, rowLevelPermission('uctoo/uctoo_role'), uctooRoleController.edit);
uctoouctooRoleRouter.post('/del', requireUser, rowLevelPermission('uctoo/uctoo_role'), uctooRoleController.delete);

//For getting uctooRole with permission control
uctoouctooRoleRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/uctoo_role'), uctooRoleController.getSingle);
uctoouctooRoleRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/uctoo_role'), uctooRoleController.getMany);
uctoouctooRoleRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/uctoo_role'), uctooRoleController.getMany);

//#endregion AutoCreateCode
export default uctoouctooRoleRouter;
